import request from '@/utils/request'
// ===========企业管理===============
// 招聘企业列表
export function getCompanyList() {
  return request({
    url: '/edu/eduCompany/list',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    method: 'get'
  })
}
// 招聘企业分页列表
export function getCompanyListPage(params) {
  return request({
    url: '/edu/eduCompany/listPage',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8',
      'pageNum': params.pageNum,
      'pageSize': params.pageSize
    },
    method: 'get',
    params: params
  })
}
// post-新增招聘企业 put=修改 delete=删除
export function dealCompanyMsg(msg, params) {
  return request({
    url: '/edu/eduCompany',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    method: msg,
    data: params
  })
}

// 删除招聘企业
export function deleteCompany(params) {
  return request({
    url: '/edu/eduCompany',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    method: 'delete',
    data: params
  })
}
// ====================招聘发布管理==============
// 招聘需求分页列表
export function getJobCompanyList(params) {
  return request({
    url: '/edu/eduCourses/listPage',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8',
      'pageNum': params.pageNum,
      'pageSize': params.pageSize
    },
    method: 'get',
    params: params
  })
}

// 岗位类型列表
export function getJobCategory(params) {
  return request({
    url: '/edu/eduCategory/list',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    method: 'get',
    params: params
  })
}
//岗位亮点分页列表
export function getJobStrengthList() {
  return request({
    url: '/edu/eduStrengths/pub/listPage',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8',
      'pageNum': 0,
      'pageSize': 1000
    },
    method: 'get',
  })
}
//查看岗位详情/编辑岗位详情
export function getJobInfo(params) {
  return request({
    url: '/edu/eduCourses/get',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8',
    },
    method: 'get',
    params: params
  })
}
//新增岗位亮点
export function addJobStrength(data) {
  return request({
    url: '/edu/eduStrengths',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    method: 'post',
    data
  })
}
//置顶岗位
export function makeJobTop(data) {
  return request({
    url: '/edu/eduCourses/top',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
      // 'Content-Type': 'application/json;charset=UTF-8'
    },
    method: 'post',
    params: data
  })
}
// 新增招聘需求
export function addJobOffers(data) {
  return request({
    url: '/edu/eduCourses',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    method: 'post',
    data
  })
}

// 修改招聘需求
export function modifyJobOffers(data) {
  return request({
    url: '/edu/eduCourses',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    method: 'put',
    data
  })
}

// 批量暂停
export function showJobOffers(data, show) {
  return request({
    url: '/edu/eduCourses/show?show=' + (show ? 1 : 0),
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    method: 'post',
    data: data
  })
}

// ==========简历管理==============
// 简历投递记录分页列表
export function getJobOffersRecord(data) {
  return request({
    url: '/edu/eduCoursesRecord/listPage',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8',
      'pageNum': data.pageNum,
      'pageSize': data.pageSize
    },
    method: 'get',
    params: data
  })
}
// 岗位名称检索列表
export function getJobCategoryOffices() {
  return request({
    url: '/edu/eduCoursesRecord/courses',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    method: 'get'
  })
}

// 修改简历投递人状态
export function editJobOffersRecord(data) {
  return request({
    url: '/edu/eduCoursesRecord/update',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    method: 'put',
    data
  })
}

// 导出excel
export function exportExcel(data) {
  return request({
    url: '/edu/eduCoursesRecord/export',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8',
      'pageNum': data.pageNum,
      'pageSize': data.pageSize
    },
    method: 'get',
    params: data
  })
}



// 获取一级分类
export function getPostDepts(params) {
  return request({
    url: '/edu/eduCategory/list',
    method: 'get',
    params
  })
}

// 新增岗位
export function addPost(data) {
  return request({
    url: '/edu/eduCategory',
    method: 'post',
    data
  })
}

// 删除岗位
export function delPost(id) {
  return request({
    url: '/edu/eduCategory/' + id,
    method: 'delete'
  })
}

// 编辑岗位
export function editPost(data) {
  return request({
    url: '/edu/eduCategory',
    method: 'put',
    data
  })
}
